<template>
    <div>
        <h2>修改学生</h2>
        <InputElement v-model="student.name">姓名</InputElement>
        <InputElement v-model="student.age">年龄</InputElement>
        <RadioElement v-model="student.gender" name="updateGender"
            >性别</RadioElement
        >
        <input type="button" value="修改" @click="handleUpdate"/>
    </div>
</template>

<script>
import InputElement from "../InputElement.vue";
import RadioElement from "../RadioElement.vue";
import {update} from '../../services/student';
export default {
    props: ["student"],
    methods: {
        async handleUpdate() {
          await update(this.student);
          this.$emit('show');
        },
    },
    components: {
        InputElement,
        RadioElement,
    },
};
</script>

<style>
</style>